package learn.up.java.designMode.observer.highend;

/**
 *
 * @author NANUTO
 * @date 2017年11月27日 上午12:10:54
 */
public class Client {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//1.创建目标
		ConcreteSubject sub  = new ConcreteSubject();
		//2.创建观察者
		ConcreteObserver ob1 = new ConcreteObserver();
		ob1.setObserverName("QQ");
		ob1.setRemindMessage("按时吃饭，不开心的时候就出去走走");
		ConcreteObserver ob2 = new ConcreteObserver();
		ob2.setObserverName("QQ's Mummy");
		ob2.setRemindMessage("保养肌肤");
		ConcreteObserver ob3 = new ConcreteObserver();
		ob3.setObserverName("QQ's Daddy");
		ob3.setRemindMessage("多喝点黑芝麻，保养肌肤，提升睡眠质量");
		
		//3.注册观察者
		sub.attach(ob1);
		sub.attach(ob2);
		sub.attach(ob3);
		
		//4.天气改变，
		sub.setWeatherContent("下雪");
	}
}
